import {NgModule}  from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { BootstrapComponent } from './bootstrap.component';
import {ContentComponent} from "../content/content.component";
import {CenterComponent} from "../center/center.component";

const appChildNextRoutes: Routes = [
  {path: ":id", component: ContentComponent},
  {
    path: '**', redirectTo: "3"
  }
];

// 定义常量,嵌套自路由
const appChildRoutes: Routes = [
  {path: ":type", component: CenterComponent,children:appChildNextRoutes},
  {
    path: '**', redirectTo: "2"
  }
];

const routes: Routes = [
  {
    path: ':index',
    component: BootstrapComponent,
    children: appChildRoutes,
  },
  {path: '**', redirectTo: "1"}
];

@NgModule({
  imports:[
    RouterModule.forChild(routes)
  ]
})

export class BootstrapRouting {}
